edaff474e8f5b77bd9952a3bd3d314aa6ac1ee03,plugins/git4idea/src/git4idea/actions/GitCompareWithBranchAction.java,OnBranchChooseRunnable,showDiffWithBranch,#Project#VirtualFile#String#String#,197

Before Change



    private static void showDiffWithBranch(@NotNull Project project, @NotNull VirtualFile file, @NotNull String head, @NotNull String branchToCompare) throws VcsException {
      final FilePath filePath = new FilePathImpl(file);
      final VcsRevisionNumber currentRevisionNumber = GitHistoryUtils.getCurrentRevision(project, filePath, head);
      final VcsRevisionNumber compareRevisionNumber = GitHistoryUtils.getCurrentRevision(project, filePath, branchToCompare);
      if (compareRevisionNumber == null) {
        fileDoesntExistInBranchError(project, file, branchToCompare);

After Change


      final FilePath filePath = new FilePathImpl(file);
      // we could use something like GitRepository#getCurrentRevision here,
      // but this way we can easily identify if the file is available in the branch
      final GitRevisionNumber currentRevisionNumber = (GitRevisionNumber)GitHistoryUtils.getCurrentRevision(project, filePath, head);
      final GitRevisionNumber compareRevisionNumber =
        (GitRevisionNumber)GitHistoryUtils.getCurrentRevision(project, filePath, branchToCompare);